
cc.Class({
    extends: require('wy-Component'),

    properties: {
        launcher : require('SkillLauncher'),
        players : cc.Node,
    },

    // LIFE-CYCLE CALLBACKS:

    onLoad () {
      
        this.n_fireTime = 0
        this.n_playerId = 0;
    },

    start () {
        this.launcher.setSkillParentNode(this.launcher.node,true);
        this.setPlaneId(3)
    },

    
    setPlaneId(){
        this.level = 4
        this.startFire();
    },
    startFire(){
        this.launcher.reset();
        // this.launcher.node.y = (this.n_playerId==2?-60:10)
        var option = global.DataConfig.monster['player3']
        var skills = option.status[Math.min(4,this.level)];

        this.launcher.addLauncher(option.status[Math.min(4,3)])
        if(this.level===4){
            this.unscheduleAllCallbacks()
            this.ani().play(this.ani()._clips[0].name);
            SoundMgr.playSound('Audio/Transform_hero_0',false,0.5);
            this.scheduleOnce(()=>{
                this.players.getChildByName('baozou').active=true;
                this.launcher.reset();
                this.launcher.addLauncher(skills)
            },0.5)
        }
    },

    ani(){
        return this.players.getChildByName('change1').getComponent(cc.Animation)
    },

});
